package routers

import (
	"beego-curd/controllers"
	"github.com/astaxie/beego"
)

func init() {
    //beego.Router("/", &controllers.MainController{})
	beego.Router("/", &controllers.HomeController{})
	beego.Router("/user", &controllers.HomeController{},"*:Get")
	beego.Router("/home/edit", &controllers.EditHomeController{})
	beego.Router("/home/update", &controllers.UpdateHomeController{})
	beego.Router("/home/delete", &controllers.DeleteHomeController{})
	beego.Router("/home/list", &controllers.UserController{})
	beego.Router("/home/login", &controllers.LoginController{})
	beego.Router("/home/logout", &controllers.LogoutController{})
	beego.Router("/cache", &controllers.CacheController{})

	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/object",
			beego.NSInclude(
				&controllers.ObjectController{},
			),
		),
	)
	beego.AddNamespace(ns)
}